package com.pucong.gitee.database.backup.common.entity.database;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pucong.gitee.database.backup.common.selfenum.DatabaseTypeEnum;
import com.pucong.gitee.database.backup.common.selfenum.DatabaseVersionEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@TableName("AUTO_DATA_SOURCE")
@ApiModel("数据库表")
public class AutoDataSource implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "UUID",type = IdType.INPUT)
    @ApiModelProperty("主键")
    private String uuid;

    @NotBlank
    @TableField("CONNECT_NAME")
    @ApiModelProperty("连接名称")
    private String connectName;

    @NotBlank
    @TableField("HOST")
    @ApiModelProperty("IP地址")
    private String host;

    @NotNull
    @TableField("PORT")
    @ApiModelProperty(value = "端口号",example = "1")
    private Integer port;

    @NotNull
    @TableField("DATABASE_TYPE")
    @ApiModelProperty("数据库类型")
    private DatabaseTypeEnum databaseType;

    @TableField("DATABASE_VERSION")
    @ApiModelProperty("数据库版本")
    private DatabaseVersionEnum databaseVersion;

    @NotBlank
    @TableField("DATABASE_NAME")
    @ApiModelProperty("数据库名称")
    private String databaseName;

    @TableField("SCHEMA_NAME")
    @ApiModelProperty("模式名称")
    private String schemaName;

    @NotBlank
    @TableField("USERNAME")
    @ApiModelProperty("用户名")
    private String username;

    @NotBlank
    @TableField("PASSWORD")
    @ApiModelProperty("密码")
    private String password;

    @TableField("DESCRIPTION")
    @ApiModelProperty("描述")
    private String description;

    @TableField("CREATE_TIME")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @TableField("CREATE_BY")
    @ApiModelProperty("创建人")
    private String createBy;
}
